package com.intelligent.ispc.common.utils;

import java.io.File;
import java.util.Map;

/**
 * Created by Peter on 2016/3/15.
 */
public class FileUtils {

    public static boolean deleteFile(String sPath) {
        boolean flag = false;
        File file = new File(sPath);
        if (file.isFile() && file.exists()) {
            file.delete();
            flag = true;
        }

        return flag;
    }

    public static boolean deleteFile(String[] path) {
        boolean flag = false;
        for (String key : path) {
            flag = deleteFile(key);
        }
        return flag;
    }

    public static boolean createFile (String sPath) {
        boolean flag = false;
        File file =new File(sPath);
        if  (!file .exists()  && !file.isDirectory())
        {
            file .mkdir();
            flag = true;

        }
        return flag;
    }
}
